﻿<%@ Page Title="" Language="C#" MasterPageFile="~/GuestView.master" AutoEventWireup="true" CodeBehind="SellerBid.aspx.cs" Inherits="BestBuy.SellerViews.SellerBid" %>
<%@ Register TagPrefix="uc" TagName="MessagePanel" Src="~/UserControls/MessagePanel.ascx" %>
<%@ Register TagPrefix="Timer" TagName="TimeCountDown" Src="~/UserControls/TimeCountDown.ascx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/Seller.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div class="tab_content">
        <div> 
            <uc:MessagePanel ID="SellerBidMessage" runat="server" />
        </div>        
        <div align="right">
            <asp:Button ID="btnBookmark" runat="server" Text="Bookmark" CssClass="btn" 
                onclick="btnBookmark_Click" Visible="False" />
        </div>
   <table class="table table-bordered">
        <tr>
            <td width="50%">
                <asp:Label ID="lbTitle" runat="server"></asp:Label>
                <br />
                <asp:Image ID="imgProduct" CssClass="img-rounded" runat="server" />
            </td>
            <td>
                <div>About Buyer</div>
                <div>Username: <asp:Label ID="lbUsername" runat="server"></asp:Label></div>
                <div>Member since <asp:Label ID="lbSince" runat="server"></asp:Label></div>
                <div>Positive Reviews: <asp:Label ID="lbPositiveRev" runat="server"></asp:Label></div>
                <div>Negative Reviews: <asp:Label ID="lbNegativeRev" runat="server"></asp:Label></div>
                <a href="#">Report Abuse</a>
                <asp:Panel ID="pnSelectWonSeller" runat="server" Visible="false">
                    <div style="text-align:right;">
                    <asp:Button CssClass="btn" ID="btnSelectSeller" Text="Select won seller" runat="server" OnClick="btnSelectSeller_Click" />
                    </div>
                </asp:Panel>

            </td>
        </tr>
    </table>
        <div>
        <div > The buyer is looking for:</div>
        <asp:Label ID ="lbLookingFor" runat="server"></asp:Label>
        <div > Description</div>
        <asp:Label ID ="lbDescription" runat="server"></asp:Label>
        <div > Quantity : <asp:Label ID ="lbQuantity" runat="server"></asp:Label></div>
        <div > Start Price :<asp:Label ID ="lbStartPrice" runat="server"></asp:Label></div>
    </div>
        <br />
        <!-- Tab Auction Detail and Question-->
        <div class="tabbable">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#tab_Auction_Detail" data-toggle="tab">Auction Details</a></li>
                <li><a href="#tab_Question" data-toggle="tab">Question</a></li>
            </ul>
            <div class="tab-content">
                <div class="tab-pane  active" id="tab_Auction_Detail">
                    <asp:GridView ID="gvAuctionDetail" runat="server" AutoGenerateColumns="False" 
                    Width="100%">
                        <Columns>
                            <asp:BoundField DataField="Username" HeaderText="Username"/>
                            <asp:BoundField DataField="Description"  HeaderText="Description"/>
                            <asp:BoundField DataField="BidValue" HeaderText="Cost"/>
                        </Columns>
                    </asp:GridView>
                </div>
            
                <div class="tab-pane" id="tab_Question">
                    <asp:GridView ID="gvComment" runat="server" AutoGenerateColumns="False" 
                        Width="100%" OnRowDataBound="gvComment_RowDataBound">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                <div>
                                    <div class="row-fluid border-question-answer">
                                        <div class="span3">
                                        Username :
                                        <asp:Label ID="UsernameLabel" runat="server" Text='<%# Bind("SellerID") %>'></asp:Label>
                                        <br />
                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("OnDate") %>'></asp:Label>
                                        <br />
                                        </div>
                                        <div class="span8">
                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Question") %>'></asp:Label>                                                                        
                                            <hr /> Reply <br />
                                            <asp:Label id="Label1" runat="server" Text='<%# Bind("Answer") %>'></asp:Label>
                                        </div>
                                    </div>
                                </div> <br />
                                </ItemTemplate>
                                <ItemStyle Height="50px" Width="150px" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <br />
                    <hr />
                    <span> Comment :</span>
                    <div align="center">
                        <asp:TextBox ID="txtComment" Text="" runat="server" TextMode="MultiLine" 
                            Width="90%"></asp:TextBox>
                        <br />
                        <asp:Button CssClass="btn" ID="btnPostComment" runat="server" Text="Post" 
                            onclick="btnPostComment_Click" />
                        <br />
                        <br />
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="tab_dock_right">
      <asp:HiddenField ID="hidAuctionID" runat="server" />        
      <div class="frame">
        <div class="fontTitle"> Closing Date</div>
        <asp:Label ID="lbClosingDate" runat="server">d</asp:Label>
        <div id="timelabel"></div>
        <div class="fontTitle"> Countdown</div>
        <Timer:TimeCountDown ID="Timer" runat="server" />
      </div>
      <br />
      <br />
      <asp:Panel ID="pnSellerBid" runat="server" Visible="False">
          <div class="frame">
        <label class="fontTitle"> My bid to the sell this item:</label><br />
        <label> Description:</label>
        <asp:TextBox ID="txtDescription" runat="server" 
                  ontextchanged="txtDescription_TextChanged" TextMode="MultiLine" 
                  Width="90%"></asp:TextBox>
        <br /><br />
        
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>
        <span>$</span>
        <asp:TextBox ID="txtPerItem" runat="server" 
              ontextchanged="txtPerItem_TextChanged" AutoPostBack="True"></asp:TextBox>
        <span>Per item</span>
        <div> x Quantity: <asp:Label ID="lbQuantity1" runat="server"></asp:Label> </div>
        <span>$</span>
        <asp:TextBox ID = "txtTotalBid" runat="server" ReadOnly="True"></asp:TextBox>
        <span>Total bid</span>
        </ContentTemplate>
        </asp:UpdatePanel>

        <br />
        <asp:Button ID="btnBid" runat="server" Text="Bid" onclick="btnBid_Click" 
                  CssClass="btn" />
          <br />
      </div>
        </asp:Panel>
        <br />
      <div class="frame">
        <div class="fontTitle">List Best Cost</div>

          <br />
          <asp:GridView ID="gvListBestBid" runat="server" AutoGenerateColumns="False" 
               Width="90%">
              <Columns>
                  <asp:BoundField DataField="Username" HeaderText="Username" ReadOnly="True" 
                      SortExpression="SellerID" />
                  <asp:BoundField DataField="BidValue" HeaderText="BidValue" ReadOnly="True" 
                      SortExpression="BidValue" />
              </Columns>
          </asp:GridView>
      </div>
    </div>  
</asp:Content>
